<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>YDLIDAR-SS SDK: include/ydlidar_driver.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="ydliar.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">YDLIDAR-SS SDK
   &#160;<span id="projectnumber">V2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">ydlidar_driver.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef YDLIDAR_DRIVER_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define YDLIDAR_DRIVER_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;atomic&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;serial.h&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;locker.h&quot;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;thread.h&quot;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;ydlidar_protocol.h&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#if !defined(__cplusplus)</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#ifndef __cplusplus</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#error &quot;The YDLIDAR SDK requires a C++ compiler to be built&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespaceserial.html">serial</a>;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceydlidar.html">ydlidar</a> {</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;std::string format(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...);</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html">   26</a></span>&#160;<span class="keyword">class </span><a class="code" href="classydlidar_1_1_y_dlidar_driver.html">YDlidarDriver</a> {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;  <a class="code" href="classydlidar_1_1_y_dlidar_driver.html">YDlidarDriver</a>();</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  <span class="keyword">virtual</span> ~<a class="code" href="classydlidar_1_1_y_dlidar_driver.html">YDlidarDriver</a>();</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;  result_t connect(<span class="keyword">const</span> <span class="keywordtype">char</span> *port_path, uint32_t baudrate);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  <span class="keywordtype">void</span> disconnect();</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  <span class="keyword">static</span> std::string getSDKVersion();</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <span class="keyword">static</span> std::map&lt;std::string, std::string&gt; lidarPortList();</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <span class="keywordtype">bool</span> isscanning() <span class="keyword">const</span>;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <span class="keywordtype">bool</span> isconnected() <span class="keyword">const</span>;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  <span class="keywordtype">void</span> setIntensities(<span class="keyword">const</span> <span class="keywordtype">bool</span> &amp;isintensities);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="keywordtype">void</span> setAutoReconnect(<span class="keyword">const</span> <span class="keywordtype">bool</span> &amp;enable);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  result_t getHealth(<a class="code" href="structdevice__health.html">device_health</a> &amp;health, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  result_t getDeviceInfo(<a class="code" href="structdevice__info.html">device_info</a> &amp;info, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  result_t startScan(<span class="keywordtype">bool</span> force = <span class="keyword">false</span>, uint32_t timeout = DEFAULT_TIMEOUT) ;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;  result_t stop();</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  result_t grabScanData(<a class="code" href="structnode__info.html">node_info</a> *nodebuffer, <span class="keywordtype">size_t</span> &amp;count, uint32_t timeout = DEFAULT_TIMEOUT) ;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;  result_t ascendScanData(<a class="code" href="structnode__info.html">node_info</a> *nodebuffer, <span class="keywordtype">size_t</span> count);</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;  result_t reset(uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  result_t getScanFrequency(<a class="code" href="structscan__frequency.html">scan_frequency</a> &amp;frequency, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;  result_t setScanFrequencyAdd(<a class="code" href="structscan__frequency.html">scan_frequency</a> &amp;frequency, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;  result_t setScanFrequencyDis(<a class="code" href="structscan__frequency.html">scan_frequency</a> &amp;frequency, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;  result_t setScanFrequencyAddMic(<a class="code" href="structscan__frequency.html">scan_frequency</a> &amp;frequency, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;  result_t setScanFrequencyDisMic(<a class="code" href="structscan__frequency.html">scan_frequency</a> &amp;frequency, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;  result_t getSamplingRate(<a class="code" href="structsampling__rate.html">sampling_rate</a> &amp;rate, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;  result_t setSamplingRate(<a class="code" href="structsampling__rate.html">sampling_rate</a> &amp;rate, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;  result_t getZeroOffsetAngle(<a class="code" href="structoffset__angle.html">offset_angle</a>&amp; angle, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;  result_t createThread();</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;  result_t startAutoScan(<span class="keywordtype">bool</span> force = <span class="keyword">false</span>, uint32_t timeout = DEFAULT_TIMEOUT) ;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;  result_t stopScan(uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;  result_t waitPackage(<a class="code" href="structnode__info.html">node_info</a> *node, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;  result_t waitScanData(<a class="code" href="structnode__info.html">node_info</a> *nodebuffer, <span class="keywordtype">size_t</span> &amp;count, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;  <span class="keywordtype">int</span> cacheScanData();</div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;</div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;  result_t sendCommand(uint8_t cmd, <span class="keyword">const</span> <span class="keywordtype">void</span> *payload = NULL, <span class="keywordtype">size_t</span> payloadsize = 0);</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;  result_t waitResponseHeader(<a class="code" href="structlidar__ans__header.html">lidar_ans_header</a> *header, uint32_t timeout = DEFAULT_TIMEOUT);</div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;</div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  result_t waitForData(<span class="keywordtype">size_t</span> data_count, uint32_t timeout = DEFAULT_TIMEOUT,</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;                       <span class="keywordtype">size_t</span> *returned_size = NULL);</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;  result_t getData(uint8_t *data, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;  result_t sendData(<span class="keyword">const</span> uint8_t *data, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;</div><div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;</div><div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;  <span class="keywordtype">void</span> checkTransDelay();</div><div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;</div><div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;  <span class="keywordtype">void</span> disableDataGrabbing();</div><div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;</div><div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;  <span class="keywordtype">void</span> setDTR();</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;</div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;  <span class="keywordtype">void</span> clearDTR();</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;  result_t checkAutoConnecting();</div><div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;</div><div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;</div><div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00404"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#a4457578961d36ce22035d778c0fd7f06">  404</a></span>&#160;  std::atomic&lt;bool&gt;     <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#a4457578961d36ce22035d778c0fd7f06">isConnected</a>;  </div><div class="line"><a name="l00405"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#a245115a8c8a4f98d988fbee06810d0a4">  405</a></span>&#160;  std::atomic&lt;bool&gt;     <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#a245115a8c8a4f98d988fbee06810d0a4">isScanning</a>;   </div><div class="line"><a name="l00406"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#aa9fe773e62367a784c888d97c1886661">  406</a></span>&#160;  std::atomic&lt;bool&gt;     <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#aa9fe773e62367a784c888d97c1886661">isAutoReconnect</a>;  </div><div class="line"><a name="l00407"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#a4fcf172c55eabd5c6ca2d8c2bf14e5c6">  407</a></span>&#160;  std::atomic&lt;bool&gt;     <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#a4fcf172c55eabd5c6ca2d8c2bf14e5c6">isAutoconnting</a>;  </div><div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;</div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;</div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;  <span class="keyword">enum</span> {</div><div class="line"><a name="l00411"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#abbb612f1ac6a9f6dfdcfeafb149dd0daa07c79ce96f468ff4b40495ef84584442">  411</a></span>&#160;    DEFAULT_TIMEOUT = 2000,    </div><div class="line"><a name="l00412"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#abbb612f1ac6a9f6dfdcfeafb149dd0daa94033b4717c83f52cd008fe38b712e21">  412</a></span>&#160;    DEFAULT_HEART_BEAT = 1000, </div><div class="line"><a name="l00413"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#abbb612f1ac6a9f6dfdcfeafb149dd0daa3db6fc46c7ce55cdf3a968b70e96374a">  413</a></span>&#160;    MAX_SCAN_NODES = 2048,     </div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;    DEFAULT_TIMEOUT_COUNT = 1,</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;  };</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;  <span class="keyword">enum</span> {</div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    YDLIDAR_F4 = 1,</div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    YDLIDAR_T1 = 2,</div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    YDLIDAR_F2 = 3,</div><div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    YDLIDAR_S4 = 4,</div><div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    YDLIDAR_G4 = 5,</div><div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;    YDLIDAR_X4 = 6,</div><div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;    YDLIDAR_G4PRO = 7,</div><div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;    YDLIDAR_F4PRO = 8,</div><div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;    YDLIDAR_G2_SS_1 = 9,<span class="comment">//230400</span></div><div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;    YDLIDAR_G10 = 10, <span class="comment">//256000</span></div><div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;    YDLIDAR_S4B = 11,<span class="comment">//153600</span></div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;    YDLIDAR_S2 = 12,<span class="comment">//115200</span></div><div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;    YDLIDAR_G25 = 13,<span class="comment">//512000</span></div><div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;    YDLIDAR_Tail,</div><div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;  };</div><div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;</div><div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;  <span class="keyword">enum</span> {</div><div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;    YDLIDAR_RATE_4K = 0,</div><div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;    YDLIDAR_RATE_8K = 1,</div><div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;    YDLIDAR_RATE_9K = 2,</div><div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;    YDLIDAR_RATE_10K = 3,</div><div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;  };</div><div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;</div><div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;</div><div class="line"><a name="l00441"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#aeaefa47c69cbb0439b1259bdc6ccb29e">  441</a></span>&#160;  <a class="code" href="structnode__info.html">node_info</a>      scan_node_buf[2048];  </div><div class="line"><a name="l00442"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#a106fc563bb42f19e84e8d9db1e7856fe">  442</a></span>&#160;  <span class="keywordtype">size_t</span>         <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#a106fc563bb42f19e84e8d9db1e7856fe">scan_node_count</a>;      </div><div class="line"><a name="l00443"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#afd2b3835a0e450d9b88d28d8f574148d">  443</a></span>&#160;  <a class="code" href="class_event.html">Event</a>          <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#afd2b3835a0e450d9b88d28d8f574148d">_dataEvent</a>;             </div><div class="line"><a name="l00444"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#a1bb836661c8c39c2b71c9a0de8755c5c">  444</a></span>&#160;  <a class="code" href="class_locker.html">Locker</a>         <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#a1bb836661c8c39c2b71c9a0de8755c5c">_lock</a>;             </div><div class="line"><a name="l00445"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#ac1ace85f37283559d4f2bc2797eea900">  445</a></span>&#160;  <a class="code" href="class_locker.html">Locker</a>         <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#ac1ace85f37283559d4f2bc2797eea900">_serial_lock</a>;      </div><div class="line"><a name="l00446"></a><span class="lineno"><a class="line" href="classydlidar_1_1_y_dlidar_driver.html#a9fbd1b3471c1aa4959d74524b9a92410">  446</a></span>&#160;  <a class="code" href="class_thread.html">Thread</a>           <a class="code" href="classydlidar_1_1_y_dlidar_driver.html#a9fbd1b3471c1aa4959d74524b9a92410">_thread</a>;             </div><div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;</div><div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;  <span class="keywordtype">int</span> PackageSampleBytes;             </div><div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;  <a class="code" href="classserial_1_1_serial.html">serial::Serial</a> *_serial;          </div><div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;  <span class="keywordtype">bool</span> m_intensities;                   </div><div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;  uint32_t m_baudrate;              </div><div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;  <span class="keywordtype">bool</span> isSupportMotorCtrl;          </div><div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;  uint64_t m_node_time_ns;          </div><div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;  uint64_t m_node_last_time_ns;       </div><div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;  uint32_t m_pointTime;             </div><div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;  uint32_t trans_delay;             </div><div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;</div><div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;  <a class="code" href="structnode__package.html">node_package</a> package;</div><div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;  <a class="code" href="structnode__packages.html">node_packages</a> packages;</div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;</div><div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;  uint16_t package_Sample_Index;</div><div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;  <span class="keywordtype">float</span> IntervalSampleAngle;</div><div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;  <span class="keywordtype">float</span> IntervalSampleAngle_LastPackage;</div><div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;  uint16_t FirstSampleAngle;</div><div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;  uint16_t LastSampleAngle;</div><div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;  uint16_t CheckSun;</div><div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;  uint8_t scan_frequence;</div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;  uint16_t CheckSunCal;</div><div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;  uint16_t SampleNumlAndCTCal;</div><div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;  uint16_t LastSampleAngleCal;</div><div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;  <span class="keywordtype">bool</span> CheckSunResult;</div><div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;  uint16_t Valu8Tou16;</div><div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;</div><div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;  std::string serial_port;</div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;};</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;}</div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;</div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;<span class="preprocessor">#endif // YDLIDAR_DRIVER_H</span></div><div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_a245115a8c8a4f98d988fbee06810d0a4"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#a245115a8c8a4f98d988fbee06810d0a4">ydlidar::YDlidarDriver::isScanning</a></div><div class="ttdeci">std::atomic&lt; bool &gt; isScanning</div><div class="ttdoc">扫图状态 </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:405</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_a106fc563bb42f19e84e8d9db1e7856fe"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#a106fc563bb42f19e84e8d9db1e7856fe">ydlidar::YDlidarDriver::scan_node_count</a></div><div class="ttdeci">size_t scan_node_count</div><div class="ttdoc">激光点数 </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:442</div></div>
<div class="ttc" id="namespaceydlidar_html"><div class="ttname"><a href="namespaceydlidar.html">ydlidar</a></div><div class="ttdef"><b>Definition:</b> v8stdint.h:204</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_afd2b3835a0e450d9b88d28d8f574148d"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#afd2b3835a0e450d9b88d28d8f574148d">ydlidar::YDlidarDriver::_dataEvent</a></div><div class="ttdeci">Event _dataEvent</div><div class="ttdoc">数据同步事件 </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:443</div></div>
<div class="ttc" id="structdevice__health_html"><div class="ttname"><a href="structdevice__health.html">device_health</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:139</div></div>
<div class="ttc" id="class_event_html"><div class="ttname"><a href="class_event.html">Event</a></div><div class="ttdef"><b>Definition:</b> locker.h:183</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_a9fbd1b3471c1aa4959d74524b9a92410"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#a9fbd1b3471c1aa4959d74524b9a92410">ydlidar::YDlidarDriver::_thread</a></div><div class="ttdeci">Thread _thread</div><div class="ttdoc">线程id </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:446</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_a4fcf172c55eabd5c6ca2d8c2bf14e5c6"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#a4fcf172c55eabd5c6ca2d8c2bf14e5c6">ydlidar::YDlidarDriver::isAutoconnting</a></div><div class="ttdeci">std::atomic&lt; bool &gt; isAutoconnting</div><div class="ttdoc">是否正在自动连接中 </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:407</div></div>
<div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div></div>
<div class="ttc" id="structlidar__ans__header_html"><div class="ttname"><a href="structlidar__ans__header.html">lidar_ans_header</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:183</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_a1bb836661c8c39c2b71c9a0de8755c5c"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#a1bb836661c8c39c2b71c9a0de8755c5c">ydlidar::YDlidarDriver::_lock</a></div><div class="ttdeci">Locker _lock</div><div class="ttdoc">线程锁 </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:444</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_ac1ace85f37283559d4f2bc2797eea900"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#ac1ace85f37283559d4f2bc2797eea900">ydlidar::YDlidarDriver::_serial_lock</a></div><div class="ttdeci">Locker _serial_lock</div><div class="ttdoc">串口锁 </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:445</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_a4457578961d36ce22035d778c0fd7f06"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#a4457578961d36ce22035d778c0fd7f06">ydlidar::YDlidarDriver::isConnected</a></div><div class="ttdeci">std::atomic&lt; bool &gt; isConnected</div><div class="ttdoc">串口连接状体 </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:404</div></div>
<div class="ttc" id="class_thread_html"><div class="ttname"><a href="class_thread.html">Thread</a></div><div class="ttdef"><b>Definition:</b> thread.h:20</div></div>
<div class="ttc" id="structnode__package_html"><div class="ttname"><a href="structnode__package.html">node_package</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:111</div></div>
<div class="ttc" id="namespaceserial_html"><div class="ttname"><a href="namespaceserial.html">serial</a></div><div class="ttdef"><b>Definition:</b> serial.h:11</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html_aa9fe773e62367a784c888d97c1886661"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html#aa9fe773e62367a784c888d97c1886661">ydlidar::YDlidarDriver::isAutoReconnect</a></div><div class="ttdeci">std::atomic&lt; bool &gt; isAutoReconnect</div><div class="ttdoc">异常自动从新连接 </div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:406</div></div>
<div class="ttc" id="structdevice__info_html"><div class="ttname"><a href="structdevice__info.html">device_info</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:132</div></div>
<div class="ttc" id="structsampling__rate_html"><div class="ttname"><a href="structsampling__rate.html">sampling_rate</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:144</div></div>
<div class="ttc" id="structoffset__angle_html"><div class="ttname"><a href="structoffset__angle.html">offset_angle</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:172</div></div>
<div class="ttc" id="classydlidar_1_1_y_dlidar_driver_html"><div class="ttname"><a href="classydlidar_1_1_y_dlidar_driver.html">ydlidar::YDlidarDriver</a></div><div class="ttdef"><b>Definition:</b> ydlidar_driver.h:26</div></div>
<div class="ttc" id="structnode__info_html"><div class="ttname"><a href="structnode__info.html">node_info</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:97</div></div>
<div class="ttc" id="structscan__frequency_html"><div class="ttname"><a href="structscan__frequency.html">scan_frequency</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:148</div></div>
<div class="ttc" id="classserial_1_1_serial_html"><div class="ttname"><a href="classserial_1_1_serial.html">serial::Serial</a></div><div class="ttdef"><b>Definition:</b> serial.h:109</div></div>
<div class="ttc" id="class_locker_html"><div class="ttname"><a href="class_locker.html">Locker</a></div><div class="ttdef"><b>Definition:</b> locker.h:20</div></div>
<div class="ttc" id="structnode__packages_html"><div class="ttname"><a href="structnode__packages.html">node_packages</a></div><div class="ttdef"><b>Definition:</b> ydlidar_protocol.h:121</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
